 package srdb.migration.schema.metadata;
 
 public class Trigger extends DBObject
 {
   private String triggerName = null;
   private String type = null;
   private String event = null;
   private Table parentTable = null;
   private String tableOwnerName = null;
   private String ownerName = null;
   private String body = "";
   private boolean whenClause = false;
 
   public Trigger()
   {
   }
 
   public boolean isWhenClause() {
     return this.whenClause;
   }
 
   public void setWhenClause(boolean whenClause) {
     this.whenClause = whenClause;
   }
 
   public Trigger(String TriggerName) {
     this.triggerName = TriggerName;
   }
 
   public void setDetails(Table parentTable, String type, String event) {
     this.parentTable = parentTable;
     this.type = type;
     this.event = event;
   }
 
   public String getName() {
     return this.triggerName;
   }
 
   public String getOwnerName() {
     return this.ownerName;
   }
 
   public void setOwnerName(String newOwnerName) {
     this.ownerName = newOwnerName;
   }
 
   public void setBody(String Body) {
     this.body += Body;
   }
 
   public String getTableName() {
     return this.parentTable != null ? this.parentTable.getName() : null;
   }
 
   public String getType() {
     return this.type;
   }
 
   public String getEvent() {
     return this.event;
   }
 
   public String getBody() {
     return this.body;
   }
 
   public boolean isBeforeTrigger()
   {
     return this.type.startsWith("BEFORE");
   }
 
   public boolean isAfterTrigger()
   {
     return this.type.startsWith("AFTER");
   }
 
   public boolean isRowLevelTrigger()
   {
     return this.type.endsWith("EACH ROW");
   }
 
   public String getTableOwnerName()
   {
     return this.tableOwnerName;
   }
 
   public void setTableOwnerName(String tableOwnerName) {
     this.tableOwnerName = tableOwnerName;
   }
 
   public DBObject getParent()
   {
     return this.parentTable;
   }
 
   public String getSchema()
   {
     return this.parentTable != null ? this.parentTable.getSchema() : null;
   }
 }

/* 

 * 
 */